var huizongbiao = new Vue({
    el : '#Huizongbiaolist',
    data:{
        xiangmuId : $("#xiangmuId").val(),
        xiangmu : {},
        HuizongbiaoList : [],
        show : false,
        total:0,

    },
    created : function() {
        var _this = this;

        $(".nav navbar-nav li").removeClass("active");
        $("#nav_huizongbiao").addClass("active");
        _this.bindHuizongbiaoList();
        _this.bindXiangmu();



    },
    methods : {

        bindXiangmu:function (){
            var _this = this;
            layer.open({type:3});
            $.post('/xiangmu/find_one', {
                xianmguid : _this.xiangmuId,
                rdm : Math.random()
            },function(ppData) {
                layer.closeAll("loading");
                if(ppData != null){
                    if(ppData.result == "1"){
                        var data = ppData.resultContent;
                        _this.xiangmu = data;
                    }else{
                        layer.alert(ppData.message);
                    }
                }
            },"json");
        },

        bindHuizongbiaoList:function (){
            var _this = this;
            layer.open({type:3});
            $.post("/tongkeyaopinjieguo/findHuizongbiaolist",{
                xiangmuid : _this.xiangmuId,

                rdm : Math.random()
            },function(ppData){
                layer.closeAll("loading");
                if (ppData != null){
                    if(ppData.result == "1"){
                        var data=ppData.resultContent;
                        var mmHtml = "<div class='table-head'><table class=\"table table-hover table-bordered\" style=\"overflow:hidden; margin-bottom:10px;table-layout:fixed;\" v-if=\"show\" cellspacing=\"0\" cellpadding=\"0\">\n" +
                            "   <thead >\n" +
                            "    <tr style=\"font-weight: bold;\">\n" +
                            "        <td style=\"text-align:center;vertical-align:middle;width:50px;\" rowspan=\"2\">排名</td>\n" +
                            "        <td style=\"text-align:center;vertical-align:middle;width:50px;\" rowspan=\"2\">序号</td>\n" +
                            "        <td style=\"text-align:center;vertical-align:middle;width:100px;\" rowspan=\"2\" >药品名称</td>\n" +
                            "        <td style=\"text-align:center;vertical-align:middle;width:100px;\" rowspan=\"2\" >规格</td>\n" +
                           /* "        <td style=\"text-align:center;vertical-align:middle;width:110px;\" rowspan=\"2\" >生产厂家</td>\n" +*/
                            "        <td style=\"text-align:center;vertical-align:middle;width:50px;\" rowspan=\"2\" >单位</td>\n" +
                            /*"        <td style=\"text-align:center;vertical-align:middle;width:53px;\" rowspan=\"2\" >价格（元）</td>\n" +*/
                            "        <td style=\"text-align:center;vertical-align:middle;width:50px;\" rowspan=\"2\" >医保类别</td>\n" +
                            "        <td style=\"text-align:center;vertical-align:middle;width:50px;\" rowspan=\"2\" >基药</td>\n" +
                            "        <td style=\"text-align:center;vertical-align:middle;width:250px;\"colspan=\"5\" >建议保留条件</td>\n" +
                            "        <td style=\"text-align:center;vertical-align:middle;width:200px;\" colspan=\"4\">建议淘汰条件</td>\n" +
                            "        <td style=\"text-align:center;vertical-align:middle;width:100px;\" colspan=\"2\">所在目录</td>\n" +
                            "        <td style=\"text-align:center;vertical-align:middle;width:100px\"colspan=\"2\" >半年内无采购记录</td>\n" +
                            "        <td style=\"text-align:center;vertical-align:middle;width:50px\"rowspan=\"2\" >药剂科初选意见</td>\n" +
                            "        <td style=\"text-align:center;vertical-align:middle;width:50px\"rowspan=\"2\">专家预选意见</td>\n" +
                           /* "        <td style=\"text-align:center;vertical-align:middle;width:50px\"rowspan=\"2\">备注</td>\n" +*/
                            "       <td style=\"text-align:center;vertical-align:middle;width:100px\"rowspan=\"2\" >委员表决票数(同意数/总票数)</td>\n" +
                            "       <td style=\"text-align:center;vertical-align:middle;\" rowspan=\"2\">表决结果</td>\n" +
                            "    </tr>\n" +
                            "    <tr style=\"font-weight: bold;\">\n" +
                            "        <td style=\"text-align:center;vertical-align:middle;width:50px;\" >集采药</td>\n" +
                            /*"        <td style=\"text-align:center;vertical-align:middle;width:50px;\" >通过一致性评价</td>\n" +*/
                            "        <td style=\"text-align:center;vertical-align:middle;width:50px;\" >中药保密配方</td>\n" +
                            "        <td style=\"text-align:center;vertical-align:middle;width:50px;\" >国家中药保护</td>\n" +
                            "        <td style=\"text-align:center;vertical-align:middle;width:50px;\" >原国谈药</td>\n" +
                            "        <td style=\"text-align:center;vertical-align:middle;width:50px;\" >创新药</td>\n" +
                            "        <td style=\"text-align:center;vertical-align:middle;width:50px;\" >重点监控药</td>\n" +
                            "        <td style=\"text-align:center;vertical-align:middle;width:50px;\" >中药注射剂</td>\n" +
                            "        <td style=\"text-align:center;vertical-align:middle;width:50px;\" >严重不良反应</td>\n" +
                            "        <td style=\"text-align:center;vertical-align:middle;width:50px;\" >掉网药</td>\n" +
                            "        <td style=\"text-align:center;vertical-align:middle;width:50px;\" >院本部</td>\n" +
                            "        <td style=\"text-align:center;vertical-align:middle;width:50px;\" >秦淮</td>\n" +
                            "        <td style=\"text-align:center;vertical-align:middle;width:50px;\" >院本部</td>\n" +
                            "        <td style=\"text-align:center;vertical-align:middle;width:50px;\" >秦淮</td>\n" +
                            "    </tr></thead></table></div><div class='table-body'><table><tbody>";
                        if(data.length > 0){
                            _this.show = true;
                            _this.huizongbiaolist=data;
                            for (var i = 0; i < _this.huizongbiaolist.length; i++) {
                                var mmTongkeyaopin = _this.huizongbiaolist[i];
                                var mmResult=mmTongkeyaopin.result;
                                var mmId=mmTongkeyaopin.id;
                                var mmXuhao = mmTongkeyaopin.xuhao;
                                var mmYaopinmingcheng = mmTongkeyaopin.yaopinmingcheng;
                                var mmShengchanchangjia=mmTongkeyaopin.shengchanchangjia;
                                var mmGuige = mmTongkeyaopin.guige;
                                var mmDanwei = mmTongkeyaopin.danwei;
                                var mmJiage = mmTongkeyaopin.jiage;
                                var mmYibaoleibie = mmTongkeyaopin.yibaoleibie;
                                var mmGuojiajibenyaowu = mmTongkeyaopin.guojiajibenyaowu;
                                var mmJicaiyao = mmTongkeyaopin.jicaiyao;
                                var mmTongguopingjia = mmTongkeyaopin.tongguopingjia;
                                var mmBaomipeifang = mmTongkeyaopin.baomipeifang;
                                var mmZhongyaobaohu = mmTongkeyaopin.zhongyaobaohu;
                                var mmYuanguotanyao = mmTongkeyaopin.yuanguotanyao;
                                var mmChuanxinyao = mmTongkeyaopin.chuanxinyao;
                                var mmJiankongyao = mmTongkeyaopin.jiankongyao;
                                var mmZhusheji = mmTongkeyaopin.zhusheji;
                                var mmBuliangfanying = mmTongkeyaopin.buliangfanying;
                                var mmDiaowangyao = mmTongkeyaopin.diaowangyao;
                                var mmDongzongyao = mmTongkeyaopin.dongzongyao;
                                var mmDongzongjilu2="";
                                if(mmTongkeyaopin.dongzongjilu2!=undefined){
                                    var mmDongzongjilu2 = mmTongkeyaopin.dongzongjilu2;
                                }
                                var mmQinhuaiyao = mmTongkeyaopin.qinhuaiyao;

                                var mmQinhuaijilu2="";
                                if(mmTongkeyaopin.qinhuaijilu2!=undefined){
                                    var mmQinhuaijilu2 = mmTongkeyaopin.qinhuaijilu2;
                                }
                                var mmZhuankefenzu = mmTongkeyaopin.zhuankefenzu;
                                var mmYuxuanyijian = mmTongkeyaopin.yuxuanyijian;
                                var mmBeizhu=mmTongkeyaopin.beizhu;
                                var mmpiaoshu = mmTongkeyaopin.piaoshu;
                                var mmJieguo=mmTongkeyaopin.jieguo;
                                var mmPaiming=i+1;

                                mmHtml += "<td style='text-align:center;vertical-align:middle;width:50px;'>" + mmPaiming + "</td>";
                                mmHtml += "<td style='text-align:center;vertical-align:middle;width:50px;'>" + mmXuhao + "</td>";
                                mmHtml += "<td style='text-align:center;vertical-align:middle;width:100px;'>" + mmYaopinmingcheng + "</td>";
                                mmHtml += "<td style='text-align:center;vertical-align:middle;width:100px;'>" + mmGuige + "</td>";
                            /*    mmHtml += "<td style='text-align:center;vertical-align:middle;width:110px;'>" + mmShengchanchangjia + "</td>";*/
                                mmHtml += "<td style='text-align:center;vertical-align:middle;width:50px;'>" + mmDanwei + "</td>";
                             /*   mmHtml += "<td style='text-align:center;vertical-align:middle;width:50px;'>" + mmJiage + "</td>";*/
                                mmHtml += "<td style='text-align:center;vertical-align:middle;width:50px;'>" + mmYibaoleibie + "</td>";
                                mmHtml += "<td style='text-align:center;vertical-align:middle;width:50px;'>" + mmGuojiajibenyaowu + "</td>";
                                mmHtml += "<td style='text-align:center;vertical-align:middle;width:50px;'>" + mmJicaiyao + "</td>";
                             /*   mmHtml += "<td style='text-align:center;vertical-align:middle;width:50px;'>" + mmTongguopingjia + "</td>";*/
                                mmHtml += "<td style='text-align:center;vertical-align:middle;width:50px;'>" + mmBaomipeifang + "</td>";
                                mmHtml += "<td style='text-align:center;vertical-align:middle;width:50px;'>" + mmZhongyaobaohu + "</td>";
                                mmHtml += "<td style='text-align:center;vertical-align:middle;width:50px;'>" + mmYuanguotanyao + "</td>";
                                mmHtml += "<td style='text-align:center;vertical-align:middle;width:50px;'>" + mmChuanxinyao + "</td>";
                                mmHtml += "<td style='text-align:center;vertical-align:middle;width:50px;'>" + mmJiankongyao + "</td>";
                                mmHtml += "<td style='text-align:center;vertical-align:middle;width:50px;'>" + mmZhusheji + "</td>";
                                mmHtml += "<td style='text-align:center;vertical-align:middle;width:50px;'>" + mmBuliangfanying + "</td>";
                                mmHtml += "<td style='text-align:center;vertical-align:middle;width:50px;'>" + mmDiaowangyao + "</td>";
                             /*   mmHtml += "<td style='text-align:center;vertical-align:middle;width:50px;'>" + mmDongzongyao + "</td>";
                                mmHtml += "<td style='text-align:center;vertical-align:middle;width:50px;'>" + mmQinhuaiyao + "</td>";*/
                                mmHtml += "<td style='text-align:center;vertical-align:middle;width:50px;word-wrap:break-word;word-break:break-all;'>" + mmDongzongjilu2 + "</td>";
                                mmHtml += "<td style='text-align:center;vertical-align:middle;width:50px;word-wrap:break-word;word-break:break-all;'>" + mmQinhuaijilu2 + "</td>";
                                /*mmHtml += "<td style='text-align:center;vertical-align:middle;width:50px;'>" + mmZhuankefenzu + "</td>";*/
                                mmHtml += "<td style='text-align:center;vertical-align:middle;width:50px;'>" + mmYuxuanyijian + "</td>";
                                mmHtml += "<td style='text-align:center;vertical-align:middle;width:50px;'>" + mmBeizhu + "</td>";
                                mmHtml +="<td style='text-align:center;vertical-align:middle;height: 100%;width:100px'>" + mmpiaoshu + "</td>";
                                if(mmJieguo=='通过'){
                                    mmHtml += "<td style='text-align:center;vertical-align:middle;color: green'>" + mmJieguo + "</td>";
                                }else {
                                    mmHtml += "<td style='text-align:center;vertical-align:middle;color: red'>" + mmJieguo + "</td>";
                                }
                                mmHtml += "</tr>";

                            }

                        }else {
                            _this.show = false;
                        }
                        mmHtml += "</table>";
                        $("#List").html(mmHtml);
                    }else{
                        layer.alert(ppData.message);
                    }
                }

            },"json");
        },



    },
    watch :{
        //监控分页情况，刷新列表
        pageIndex : function(){

            this.bindHuizongbiaoList();
        }
    }
})